Twenty (or so) Questions: Bounded-Length Huffman Coding
نویسنده
چکیده
The game of Twenty Questions has long been used to illustrate binary source coding. Recently, a physical device has been developed which mimics the process of playing Twenty Questions, with the device supplying the questions and the user providing the answers. However, this game differs from Twenty Questions in two ways: Answers need not be only “yes” and “no,” and the device continues to ask questions beyond the traditional twenty; typically, at least 20 and at most 25 questions are asked. The nonbinary variation on source coding is one that is well known and understood, but not with such bounds on length. An O(n(lmax − lmin))-time O(n)space Package-Merge-based algorithm is presented here for binary and nonbinary source coding with codeword lengths (numbers of questions) bounded to be within a certain interval, one that minimizes average codeword length or, more generally, any other quasiarithmetic convex coding penalty. In the case of minimizing average codeword length, both time and space complexity can be improved via an alternative reduction. This has, as a special case, a method for nonbinary length-limited Huffman coding, which was previously solved via dynamic programming with O(n2lmax logD) time and space.
منابع مشابه
Twenty (or so) Questions: D-ary Bounded-Length Huffman Coding
The game of Twenty Questions has long been used to illustrate binary source coding. Recently, a physical device has been developed that mimics the process of playing Twenty Questions, with the device supplying the questions and the user providing the answers. However, this game differs from Twenty Questions in two ways: Answers need not be only “yes” and “no,” and the device continues to ask qu...
متن کاملTwenty (or so) Questions: $D$-ary Length-Bounded Prefix Coding
Efficient optimal prefix coding has long been accomplished via the Huffman algorithm. However, there is still room for improvement and exploration regarding variants of the Huffman problem. Length-limited Huffman coding, useful for many practical applications, is one such variant, for which codes are restricted to the set of codes in which none of the n codewords is longer than a given length, ...
متن کاملTwenty Questions Games Always End With Yes
Huffman coding is often presented as the optimal solution to Twenty Questions. However, a caveat is that Twenty Questions games always end with a reply of “Yes,” whereas Huffman codewords need not obey this constraint. We bring resolution to this issue, and prove that the average number of questions still lies between H(X) and H(X) + 1.
متن کاملVariations on a theme by Huffman
Abstruct-In honor of the twenty-fifth amdversary of Huffman coding, four new results about Huffman codes are presented. 'Ibe ffrst result shows that a binary prefix condition code is a Huffmau code iff the intermediate and terminal nodes id the code tree can be listed by nonin-creasing probabiuty so that each node in the fist is adjacent to its sibling. The second result upper bounds the redund...
متن کاملNon binary huffman code pdf
A Method for the Construction of Minimum-Redundancy Codes PDF.HUFFMAN CODES. Corollary 28 Consider a coding from a length n vector of source symbols, x x1x2.xn, to a binary codeword of length lx. Then the.Correctness of the Huffman coding nitro pdf reader 32 bit 1 1 1 13 create pdf files algorithm. A binary code encodes each character as a binary. Code that encodes the file using as few bits as...
متن کامل